using System;
using Archie.Retail.AdminTool.UI.ViewModels;
using Archie.Retail.AdminTool.WpfFeatures;
using Archie.Retail.Data;

namespace Archie.Retail.AdminTool.UI
{
    public class DataManagementVM : NotificationObject
    {
        public IEditor SelectedEditor
        {
            get { return _selectedEditor; }
            set 
            { 
                if (_selectedEditor == value)
                {
                    return;
                }

                _selectedEditor = value;
                OnPropertyChanged("SelectedEditor");
            }
        }

        private readonly IDataManager _dataManager;
        private IEditor _selectedEditor;
        public DoorManagementEditor DoorManagementEditor { get; private set; }

        public DataManagementVM(IDataManager dataManager)
        {
            if (dataManager == null)
            {
                throw new ArgumentNullException("dataManager");
            }

            _dataManager = dataManager;
            DoorManagementEditor = new DoorManagementEditor(_dataManager);

            Update();

            SelectedEditor = DoorManagementEditor;
        }

        private void Update()
        {
            
        }

        private void Clear()
        {
            
        }
    }
}